<?php

require_once 'PHPUnit/Framework.php';
require_once '../mvc.php';

class Request implements IControllerRequest {
	public function Request ($action) {
		$this->action = $action;
	}
	
	public function getAction() {
		return $this->action;
	}
	
	public function getParams () {
		return array();
	}
}

class MyController extends Controller {
	public function foo() {
		$this->view = false;
	}
	
	public function hello() {
	}
	
	public function getView () {
		return $this->view;
	}
}

class MvcTest extends PHPUnit_Framework_TestCase {
	public function testController () {
		//$r = new Request('waa');
		$c = new MyController(array());
		
		$c->call('foo');
		$this->assertEquals(false, $c->getView());
		
		$c->call('hello');
		$this->assertEquals('hello', $c->getView());
	}
}

?>